3.2.35 \(\int \frac {c+d x}{(a+a \cos (e+f x))^2} \, dx\) [135]

Optimal. Leaf size=123 \[ \frac {2 d \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{3 a^2 f^2}-\frac {d \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f^2}+\frac {(c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x) \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f} \]

[Out]

2/3*d*ln(cos(1/2*f*x+1/2*e))/a^2/f^2-1/6*d*sec(1/2*f*x+1/2*e)^2/a^2/f^2+1/3*(d*x+c)*tan(1/2*f*x+1/2*e)/a^2/f+1
/6*(d*x+c)*sec(1/2*f*x+1/2*e)^2*tan(1/2*f*x+1/2*e)/a^2/f

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 123, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {3399, 4270, 4269, 3556} \begin {gather*} \frac {(c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}-\frac {d \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f^2}+\frac {2 d \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{3 a^2 f^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)/(a + a*Cos[e + f*x])^2,x]

[Out]

(2*d*Log[Cos[e/2 + (f*x)/2]])/(3*a^2*f^2) - (d*Sec[e/2 + (f*x)/2]^2)/(6*a^2*f^2) + ((c + d*x)*Tan[e/2 + (f*x)/
2])/(3*a^2*f) + ((c + d*x)*Sec[e/2 + (f*x)/2]^2*Tan[e/2 + (f*x)/2])/(6*a^2*f)

Rule 3399

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(2*a)^n, Int[(c
 + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) + f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2
- b^2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 4270

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(-b^2)*(c + d*x)*Cot[e + f*x]
*((b*Csc[e + f*x])^(n - 2)/(f*(n - 1))), x] + (Dist[b^2*((n - 2)/(n - 1)), Int[(c + d*x)*(b*Csc[e + f*x])^(n -
 2), x], x] - Simp[b^2*d*((b*Csc[e + f*x])^(n - 2)/(f^2*(n - 1)*(n - 2))), x]) /; FreeQ[{b, c, d, e, f}, x] &&
 GtQ[n, 1] && NeQ[n, 2]

Rubi steps

\begin {align*} \int \frac {c+d x}{(a+a \cos (e+f x))^2} \, dx &=\frac {\int (c+d x) \csc ^4\left (\frac {e+\pi }{2}+\frac {f x}{2}\right ) \, dx}{4 a^2}\\ &=-\frac {d \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f^2}+\frac {(c+d x) \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}+\frac {\int (c+d x) \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \, dx}{6 a^2}\\ &=-\frac {d \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f^2}+\frac {(c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x) \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}-\frac {d \int \tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \, dx}{3 a^2 f}\\ &=\frac {2 d \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{3 a^2 f^2}-\frac {d \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f^2}+\frac {(c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x) \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.29, size = 113, normalized size = 0.92 \begin {gather*} \frac {\cos \left (\frac {1}{2} (e+f x)\right ) \left (2 d \cos \left (\frac {3}{2} (e+f x)\right ) \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )+2 d \cos \left (\frac {1}{2} (e+f x)\right ) \left (-1+3 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )\right )+f (c+d x) \left (3 \sin \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {3}{2} (e+f x)\right )\right )\right )}{3 a^2 f^2 (1+\cos (e+f x))^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)/(a + a*Cos[e + f*x])^2,x]

[Out]

(Cos[(e + f*x)/2]*(2*d*Cos[(3*(e + f*x))/2]*Log[Cos[(e + f*x)/2]] + 2*d*Cos[(e + f*x)/2]*(-1 + 3*Log[Cos[(e +
f*x)/2]]) + f*(c + d*x)*(3*Sin[(e + f*x)/2] + Sin[(3*(e + f*x))/2])))/(3*a^2*f^2*(1 + Cos[e + f*x])^2)

________________________________________________________________________________________

Maple [A]
time = 0.22, size = 109, normalized size = 0.89

method result size
default \(\frac {\frac {c \left (\frac {\left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{6}+\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2}\right )}{f}-\frac {d \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{6 f^{2}}+\frac {d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 f}+\frac {d x \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{6 f}-\frac {d \ln \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f^{2}}}{a^{2}}\) \(109\)
norman \(\frac {\frac {c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 a f}+\frac {c \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{6 a f}-\frac {d \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{6 a \,f^{2}}+\frac {d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 a f}+\frac {d x \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{6 a f}}{a}-\frac {d \ln \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 a^{2} f^{2}}\) \(128\)
risch \(-\frac {2 i d x}{3 a^{2} f}-\frac {2 i d e}{3 a^{2} f^{2}}-\frac {2 \left (-3 i d f x \,{\mathrm e}^{i \left (f x +e \right )}-3 i c f \,{\mathrm e}^{i \left (f x +e \right )}-i d f x -i c f +d \,{\mathrm e}^{2 i \left (f x +e \right )}+d \,{\mathrm e}^{i \left (f x +e \right )}\right )}{3 f^{2} a^{2} \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )^{3}}+\frac {2 d \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{3 a^{2} f^{2}}\) \(129\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)/(a+a*cos(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

2/a^2*(1/2*c/f*(1/6*tan(1/2*f*x+1/2*e)^3+1/2*tan(1/2*f*x+1/2*e))-1/12*d/f^2*tan(1/2*f*x+1/2*e)^2+1/4*d/f*x*tan
(1/2*f*x+1/2*e)+1/12*d/f*x*tan(1/2*f*x+1/2*e)^3-1/6*d/f^2*ln(1+tan(1/2*f*x+1/2*e)^2))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 834 vs. \(2 (100) = 200\).
time = 0.31, size = 834, normalized size = 6.78 \begin {gather*} -\frac {\frac {2 \, {\left (2 \, {\left (3 \, {\left (f x + e\right )} \sin \left (f x + e\right ) + \cos \left (2 \, f x + 2 \, e\right ) + \cos \left (f x + e\right )\right )} \cos \left (3 \, f x + 3 \, e\right ) + 2 \, {\left (9 \, {\left (f x + e\right )} \sin \left (f x + e\right ) + 6 \, \cos \left (f x + e\right ) + 1\right )} \cos \left (2 \, f x + 2 \, e\right ) + 6 \, \cos \left (2 \, f x + 2 \, e\right )^{2} + 6 \, \cos \left (f x + e\right )^{2} - {\left (2 \, {\left (3 \, \cos \left (2 \, f x + 2 \, e\right ) + 3 \, \cos \left (f x + e\right ) + 1\right )} \cos \left (3 \, f x + 3 \, e\right ) + \cos \left (3 \, f x + 3 \, e\right )^{2} + 6 \, {\left (3 \, \cos \left (f x + e\right ) + 1\right )} \cos \left (2 \, f x + 2 \, e\right ) + 9 \, \cos \left (2 \, f x + 2 \, e\right )^{2} + 9 \, \cos \left (f x + e\right )^{2} + 6 \, {\left (\sin \left (2 \, f x + 2 \, e\right ) + \sin \left (f x + e\right )\right )} \sin \left (3 \, f x + 3 \, e\right ) + \sin \left (3 \, f x + 3 \, e\right )^{2} + 9 \, \sin \left (2 \, f x + 2 \, e\right )^{2} + 18 \, \sin \left (2 \, f x + 2 \, e\right ) \sin \left (f x + e\right ) + 9 \, \sin \left (f x + e\right )^{2} + 6 \, \cos \left (f x + e\right ) + 1\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1\right ) - 2 \, {\left (f x + 3 \, {\left (f x + e\right )} \cos \left (f x + e\right ) + e - \sin \left (2 \, f x + 2 \, e\right ) - \sin \left (f x + e\right )\right )} \sin \left (3 \, f x + 3 \, e\right ) - 6 \, {\left (f x + 3 \, {\left (f x + e\right )} \cos \left (f x + e\right ) + e - 2 \, \sin \left (f x + e\right )\right )} \sin \left (2 \, f x + 2 \, e\right ) + 6 \, \sin \left (2 \, f x + 2 \, e\right )^{2} + 6 \, \sin \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right )\right )} d}{a^{2} f \cos \left (3 \, f x + 3 \, e\right )^{2} + 9 \, a^{2} f \cos \left (2 \, f x + 2 \, e\right )^{2} + 9 \, a^{2} f \cos \left (f x + e\right )^{2} + a^{2} f \sin \left (3 \, f x + 3 \, e\right )^{2} + 9 \, a^{2} f \sin \left (2 \, f x + 2 \, e\right )^{2} + 18 \, a^{2} f \sin \left (2 \, f x + 2 \, e\right ) \sin \left (f x + e\right ) + 9 \, a^{2} f \sin \left (f x + e\right )^{2} + 6 \, a^{2} f \cos \left (f x + e\right ) + a^{2} f + 2 \, {\left (3 \, a^{2} f \cos \left (2 \, f x + 2 \, e\right ) + 3 \, a^{2} f \cos \left (f x + e\right ) + a^{2} f\right )} \cos \left (3 \, f x + 3 \, e\right ) + 6 \, {\left (3 \, a^{2} f \cos \left (f x + e\right ) + a^{2} f\right )} \cos \left (2 \, f x + 2 \, e\right ) + 6 \, {\left (a^{2} f \sin \left (2 \, f x + 2 \, e\right ) + a^{2} f \sin \left (f x + e\right )\right )} \sin \left (3 \, f x + 3 \, e\right )} - \frac {c {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}{a^{2}} + \frac {d {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )} e}{a^{2} f}}{6 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+a*cos(f*x+e))^2,x, algorithm="maxima")

[Out]

-1/6*(2*(2*(3*(f*x + e)*sin(f*x + e) + cos(2*f*x + 2*e) + cos(f*x + e))*cos(3*f*x + 3*e) + 2*(9*(f*x + e)*sin(
f*x + e) + 6*cos(f*x + e) + 1)*cos(2*f*x + 2*e) + 6*cos(2*f*x + 2*e)^2 + 6*cos(f*x + e)^2 - (2*(3*cos(2*f*x +
2*e) + 3*cos(f*x + e) + 1)*cos(3*f*x + 3*e) + cos(3*f*x + 3*e)^2 + 6*(3*cos(f*x + e) + 1)*cos(2*f*x + 2*e) + 9
*cos(2*f*x + 2*e)^2 + 9*cos(f*x + e)^2 + 6*(sin(2*f*x + 2*e) + sin(f*x + e))*sin(3*f*x + 3*e) + sin(3*f*x + 3*
e)^2 + 9*sin(2*f*x + 2*e)^2 + 18*sin(2*f*x + 2*e)*sin(f*x + e) + 9*sin(f*x + e)^2 + 6*cos(f*x + e) + 1)*log(co
s(f*x + e)^2 + sin(f*x + e)^2 + 2*cos(f*x + e) + 1) - 2*(f*x + 3*(f*x + e)*cos(f*x + e) + e - sin(2*f*x + 2*e)
 - sin(f*x + e))*sin(3*f*x + 3*e) - 6*(f*x + 3*(f*x + e)*cos(f*x + e) + e - 2*sin(f*x + e))*sin(2*f*x + 2*e) +
 6*sin(2*f*x + 2*e)^2 + 6*sin(f*x + e)^2 + 2*cos(f*x + e))*d/(a^2*f*cos(3*f*x + 3*e)^2 + 9*a^2*f*cos(2*f*x + 2
*e)^2 + 9*a^2*f*cos(f*x + e)^2 + a^2*f*sin(3*f*x + 3*e)^2 + 9*a^2*f*sin(2*f*x + 2*e)^2 + 18*a^2*f*sin(2*f*x +
2*e)*sin(f*x + e) + 9*a^2*f*sin(f*x + e)^2 + 6*a^2*f*cos(f*x + e) + a^2*f + 2*(3*a^2*f*cos(2*f*x + 2*e) + 3*a^
2*f*cos(f*x + e) + a^2*f)*cos(3*f*x + 3*e) + 6*(3*a^2*f*cos(f*x + e) + a^2*f)*cos(2*f*x + 2*e) + 6*(a^2*f*sin(
2*f*x + 2*e) + a^2*f*sin(f*x + e))*sin(3*f*x + 3*e)) - c*(3*sin(f*x + e)/(cos(f*x + e) + 1) + sin(f*x + e)^3/(
cos(f*x + e) + 1)^3)/a^2 + d*(3*sin(f*x + e)/(cos(f*x + e) + 1) + sin(f*x + e)^3/(cos(f*x + e) + 1)^3)*e/(a^2*
f))/f

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 126, normalized size = 1.02 \begin {gather*} -\frac {d \cos \left (f x + e\right ) - {\left (d \cos \left (f x + e\right )^{2} + 2 \, d \cos \left (f x + e\right ) + d\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - {\left (2 \, d f x + 2 \, c f + {\left (d f x + c f\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right ) + d}{3 \, {\left (a^{2} f^{2} \cos \left (f x + e\right )^{2} + 2 \, a^{2} f^{2} \cos \left (f x + e\right ) + a^{2} f^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+a*cos(f*x+e))^2,x, algorithm="fricas")

[Out]

-1/3*(d*cos(f*x + e) - (d*cos(f*x + e)^2 + 2*d*cos(f*x + e) + d)*log(1/2*cos(f*x + e) + 1/2) - (2*d*f*x + 2*c*
f + (d*f*x + c*f)*cos(f*x + e))*sin(f*x + e) + d)/(a^2*f^2*cos(f*x + e)^2 + 2*a^2*f^2*cos(f*x + e) + a^2*f^2)

________________________________________________________________________________________

Sympy [A]
time = 0.48, size = 146, normalized size = 1.19 \begin {gather*} \begin {cases} \frac {c \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )}}{6 a^{2} f} + \frac {c \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{2 a^{2} f} + \frac {d x \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )}}{6 a^{2} f} + \frac {d x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{2 a^{2} f} - \frac {d \log {\left (\tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 1 \right )}}{3 a^{2} f^{2}} - \frac {d \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )}}{6 a^{2} f^{2}} & \text {for}\: f \neq 0 \\\frac {c x + \frac {d x^{2}}{2}}{\left (a \cos {\left (e \right )} + a\right )^{2}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+a*cos(f*x+e))**2,x)

[Out]

Piecewise((c*tan(e/2 + f*x/2)**3/(6*a**2*f) + c*tan(e/2 + f*x/2)/(2*a**2*f) + d*x*tan(e/2 + f*x/2)**3/(6*a**2*
f) + d*x*tan(e/2 + f*x/2)/(2*a**2*f) - d*log(tan(e/2 + f*x/2)**2 + 1)/(3*a**2*f**2) - d*tan(e/2 + f*x/2)**2/(6
*a**2*f**2), Ne(f, 0)), ((c*x + d*x**2/2)/(a*cos(e) + a)**2, True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 757 vs. \(2 (100) = 200\).
time = 0.61, size = 757, normalized size = 6.15 \begin {gather*} -\frac {3 \, d f x \tan \left (\frac {1}{2} \, f x\right )^{3} \tan \left (\frac {1}{2} \, e\right )^{2} + 3 \, d f x \tan \left (\frac {1}{2} \, f x\right )^{2} \tan \left (\frac {1}{2} \, e\right )^{3} - 2 \, d \log \left (\frac {4 \, {\left (\tan \left (\frac {1}{2} \, f x\right )^{4} \tan \left (\frac {1}{2} \, e\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, f x\right )^{3} \tan \left (\frac {1}{2} \, e\right ) + \tan \left (\frac {1}{2} \, f x\right )^{2} \tan \left (\frac {1}{2} \, e\right )^{2} + \tan \left (\frac {1}{2} \, f x\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, f x\right ) \tan \left (\frac {1}{2} \, e\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, e\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, f x\right )^{3} \tan \left (\frac {1}{2} \, e\right )^{3} + 3 \, c f \tan \left (\frac {1}{2} \, f x\right )^{3} \tan \left (\frac {1}{2} \, e\right )^{2} + 3 \, c f \tan \left (\frac {1}{2} \, f x\right )^{2} \tan \left (\frac {1}{2} \, e\right )^{3} + d \tan \left (\frac {1}{2} \, f x\right )^{3} \tan \left (\frac {1}{2} \, e\right )^{3} + d f x \tan \left (\frac {1}{2} \, f x\right )^{3} - 3 \, d f x \tan \left (\frac {1}{2} \, f x\right )^{2} \tan \left (\frac {1}{2} \, e\right ) - 3 \, d f x \tan \left (\frac {1}{2} \, f x\right ) \tan \left (\frac {1}{2} \, e\right )^{2} + 6 \, d \log \left (\frac {4 \, {\left (\tan \left (\frac {1}{2} \, f x\right )^{4} \tan \left (\frac {1}{2} \, e\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, f x\right )^{3} \tan \left (\frac {1}{2} \, e\right ) + \tan \left (\frac {1}{2} \, f x\right )^{2} \tan \left (\frac {1}{2} \, e\right )^{2} + \tan \left (\frac {1}{2} \, f x\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, f x\right ) \tan \left (\frac {1}{2} \, e\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, e\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, f x\right )^{2} \tan \left (\frac {1}{2} \, e\right )^{2} + d f x \tan \left (\frac {1}{2} \, e\right )^{3} + c f \tan \left (\frac {1}{2} \, f x\right )^{3} - 3 \, c f \tan \left (\frac {1}{2} \, f x\right )^{2} \tan \left (\frac {1}{2} \, e\right ) + d \tan \left (\frac {1}{2} \, f x\right )^{3} \tan \left (\frac {1}{2} \, e\right ) - 3 \, c f \tan \left (\frac {1}{2} \, f x\right ) \tan \left (\frac {1}{2} \, e\right )^{2} - d \tan \left (\frac {1}{2} \, f x\right )^{2} \tan \left (\frac {1}{2} \, e\right )^{2} + c f \tan \left (\frac {1}{2} \, e\right )^{3} + d \tan \left (\frac {1}{2} \, f x\right ) \tan \left (\frac {1}{2} \, e\right )^{3} + 3 \, d f x \tan \left (\frac {1}{2} \, f x\right ) + 3 \, d f x \tan \left (\frac {1}{2} \, e\right ) - 6 \, d \log \left (\frac {4 \, {\left (\tan \left (\frac {1}{2} \, f x\right )^{4} \tan \left (\frac {1}{2} \, e\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, f x\right )^{3} \tan \left (\frac {1}{2} \, e\right ) + \tan \left (\frac {1}{2} \, f x\right )^{2} \tan \left (\frac {1}{2} \, e\right )^{2} + \tan \left (\frac {1}{2} \, f x\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, f x\right ) \tan \left (\frac {1}{2} \, e\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, e\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, f x\right ) \tan \left (\frac {1}{2} \, e\right ) + 3 \, c f \tan \left (\frac {1}{2} \, f x\right ) - d \tan \left (\frac {1}{2} \, f x\right )^{2} + 3 \, c f \tan \left (\frac {1}{2} \, e\right ) + d \tan \left (\frac {1}{2} \, f x\right ) \tan \left (\frac {1}{2} \, e\right ) - d \tan \left (\frac {1}{2} \, e\right )^{2} + 2 \, d \log \left (\frac {4 \, {\left (\tan \left (\frac {1}{2} \, f x\right )^{4} \tan \left (\frac {1}{2} \, e\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, f x\right )^{3} \tan \left (\frac {1}{2} \, e\right ) + \tan \left (\frac {1}{2} \, f x\right )^{2} \tan \left (\frac {1}{2} \, e\right )^{2} + \tan \left (\frac {1}{2} \, f x\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, f x\right ) \tan \left (\frac {1}{2} \, e\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, e\right )^{2} + 1}\right ) - d}{6 \, {\left (a^{2} f^{2} \tan \left (\frac {1}{2} \, f x\right )^{3} \tan \left (\frac {1}{2} \, e\right )^{3} - 3 \, a^{2} f^{2} \tan \left (\frac {1}{2} \, f x\right )^{2} \tan \left (\frac {1}{2} \, e\right )^{2} + 3 \, a^{2} f^{2} \tan \left (\frac {1}{2} \, f x\right ) \tan \left (\frac {1}{2} \, e\right ) - a^{2} f^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+a*cos(f*x+e))^2,x, algorithm="giac")

[Out]

-1/6*(3*d*f*x*tan(1/2*f*x)^3*tan(1/2*e)^2 + 3*d*f*x*tan(1/2*f*x)^2*tan(1/2*e)^3 - 2*d*log(4*(tan(1/2*f*x)^4*ta
n(1/2*e)^2 - 2*tan(1/2*f*x)^3*tan(1/2*e) + tan(1/2*f*x)^2*tan(1/2*e)^2 + tan(1/2*f*x)^2 - 2*tan(1/2*f*x)*tan(1
/2*e) + 1)/(tan(1/2*e)^2 + 1))*tan(1/2*f*x)^3*tan(1/2*e)^3 + 3*c*f*tan(1/2*f*x)^3*tan(1/2*e)^2 + 3*c*f*tan(1/2
*f*x)^2*tan(1/2*e)^3 + d*tan(1/2*f*x)^3*tan(1/2*e)^3 + d*f*x*tan(1/2*f*x)^3 - 3*d*f*x*tan(1/2*f*x)^2*tan(1/2*e
) - 3*d*f*x*tan(1/2*f*x)*tan(1/2*e)^2 + 6*d*log(4*(tan(1/2*f*x)^4*tan(1/2*e)^2 - 2*tan(1/2*f*x)^3*tan(1/2*e) +
 tan(1/2*f*x)^2*tan(1/2*e)^2 + tan(1/2*f*x)^2 - 2*tan(1/2*f*x)*tan(1/2*e) + 1)/(tan(1/2*e)^2 + 1))*tan(1/2*f*x
)^2*tan(1/2*e)^2 + d*f*x*tan(1/2*e)^3 + c*f*tan(1/2*f*x)^3 - 3*c*f*tan(1/2*f*x)^2*tan(1/2*e) + d*tan(1/2*f*x)^
3*tan(1/2*e) - 3*c*f*tan(1/2*f*x)*tan(1/2*e)^2 - d*tan(1/2*f*x)^2*tan(1/2*e)^2 + c*f*tan(1/2*e)^3 + d*tan(1/2*
f*x)*tan(1/2*e)^3 + 3*d*f*x*tan(1/2*f*x) + 3*d*f*x*tan(1/2*e) - 6*d*log(4*(tan(1/2*f*x)^4*tan(1/2*e)^2 - 2*tan
(1/2*f*x)^3*tan(1/2*e) + tan(1/2*f*x)^2*tan(1/2*e)^2 + tan(1/2*f*x)^2 - 2*tan(1/2*f*x)*tan(1/2*e) + 1)/(tan(1/
2*e)^2 + 1))*tan(1/2*f*x)*tan(1/2*e) + 3*c*f*tan(1/2*f*x) - d*tan(1/2*f*x)^2 + 3*c*f*tan(1/2*e) + d*tan(1/2*f*
x)*tan(1/2*e) - d*tan(1/2*e)^2 + 2*d*log(4*(tan(1/2*f*x)^4*tan(1/2*e)^2 - 2*tan(1/2*f*x)^3*tan(1/2*e) + tan(1/
2*f*x)^2*tan(1/2*e)^2 + tan(1/2*f*x)^2 - 2*tan(1/2*f*x)*tan(1/2*e) + 1)/(tan(1/2*e)^2 + 1)) - d)/(a^2*f^2*tan(
1/2*f*x)^3*tan(1/2*e)^3 - 3*a^2*f^2*tan(1/2*f*x)^2*tan(1/2*e)^2 + 3*a^2*f^2*tan(1/2*f*x)*tan(1/2*e) - a^2*f^2)

________________________________________________________________________________________

Mupad [B]
time = 4.29, size = 175, normalized size = 1.42 \begin {gather*} \frac {2\,d\,\ln \left ({\mathrm {e}}^{e\,1{}\mathrm {i}}\,{\mathrm {e}}^{f\,x\,1{}\mathrm {i}}+1\right )}{3\,a^2\,f^2}+\frac {\left (c\,f+d\,f\,x-d\,1{}\mathrm {i}\right )\,2{}\mathrm {i}}{3\,a^2\,f^2\,\left (2\,{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}+{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+1\right )}-\frac {d\,x\,2{}\mathrm {i}}{3\,a^2\,f}-\frac {2\,d}{3\,a^2\,f^2\,\left ({\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}+1\right )}+\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}\,\left (c+d\,x\right )\,4{}\mathrm {i}}{3\,a^2\,f\,\left (3\,{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}+3\,{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+{\mathrm {e}}^{e\,3{}\mathrm {i}+f\,x\,3{}\mathrm {i}}+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)/(a + a*cos(e + f*x))^2,x)

[Out]

(2*d*log(exp(e*1i)*exp(f*x*1i) + 1))/(3*a^2*f^2) + ((c*f - d*1i + d*f*x)*2i)/(3*a^2*f^2*(2*exp(e*1i + f*x*1i)
+ exp(e*2i + f*x*2i) + 1)) - (d*x*2i)/(3*a^2*f) - (2*d)/(3*a^2*f^2*(exp(e*1i + f*x*1i) + 1)) + (exp(e*1i + f*x
*1i)*(c + d*x)*4i)/(3*a^2*f*(3*exp(e*1i + f*x*1i) + 3*exp(e*2i + f*x*2i) + exp(e*3i + f*x*3i) + 1))

________________________________________________________________________________________